package com.hzj.recipe.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 食材表
 * @TableName ingredient
 */
@TableName(value ="ingredient")
@Data
public class Ingredient implements Serializable {
    /**
     * 食材id
     */
    @TableId(value = "ingredient_id")
    private Integer ingredientId;

    /**
     * 食材名称
     */
    @TableField(value = "ingredient_name")
    private String ingredientName;

    /**
     * 描述
     */
    @TableField(value = "Ingredients_description")
    private String ingredientsDescription;

    /**
     * 食材图
     */
    @TableField(value = "Ingredients_img")
    private String ingredientsImg;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Ingredient other = (Ingredient) that;
        return (this.getIngredientId() == null ? other.getIngredientId() == null : this.getIngredientId().equals(other.getIngredientId()))
            && (this.getIngredientName() == null ? other.getIngredientName() == null : this.getIngredientName().equals(other.getIngredientName()))
            && (this.getIngredientsDescription() == null ? other.getIngredientsDescription() == null : this.getIngredientsDescription().equals(other.getIngredientsDescription()))
            && (this.getIngredientsImg() == null ? other.getIngredientsImg() == null : this.getIngredientsImg().equals(other.getIngredientsImg()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getIngredientId() == null) ? 0 : getIngredientId().hashCode());
        result = prime * result + ((getIngredientName() == null) ? 0 : getIngredientName().hashCode());
        result = prime * result + ((getIngredientsDescription() == null) ? 0 : getIngredientsDescription().hashCode());
        result = prime * result + ((getIngredientsImg() == null) ? 0 : getIngredientsImg().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ingredientId=").append(ingredientId);
        sb.append(", ingredientName=").append(ingredientName);
        sb.append(", ingredientsDescription=").append(ingredientsDescription);
        sb.append(", ingredientsImg=").append(ingredientsImg);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}